﻿@model IEnumerable<Uco.Models.TextComponent>
@using Telerik.Web.Mvc.UI
@{
    ViewBag.Title = Html.R("TextComponent");
    Layout = "~/Areas/Admin/Views/Shared/_LayoutNoTree.cshtml";
}

<h2>@Html.R("TextComponent")</h2>

@(Html.Telerik().Grid(Model)
        .Name("Grid")
        .DataKeys(keys =>
        {
            keys.Add(r => r.ID);
        })
        .DataBinding(dataBinding =>
        {
        dataBinding.Ajax()
            .Select("_AjaxIndex", "TextComponent")
            .Delete("_AjaxDelete", "TextComponent");
        })
        .Columns(columns =>
        {
            columns.Bound(r => r.ID).Width(50);
            columns.Bound(r => r.SystemName);
            columns.Command(commands =>
            {
                commands.Custom("Edit").Text(@Html.R("Edit")).DataRouteValues(route => route.Add(r => r.ID).RouteKey("ID")).Action("Edit", "TextComponent");
                commands.Delete();
            }).Width(210).Title(@Html.R("Commands"));
        })
        .Pageable()
        .Sortable()
        .Filterable()
        .Groupable()
)
<br />
@Html.ActionLink(@Html.R("Create"), "Create", null, new { @class = "t-button t-state-default" })
